package com.hpsk.shopservice.model.config.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hpsk.common.CommonVo;
import com.hpsk.validator.AddGroup;
import com.hpsk.validator.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.commons.math3.analysis.function.Add;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 列表控制器
 * </p>
 *
 * @author huangwang
 * @since 2025-03-20
 */
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "列表控制器")
public class BizConfigMenuAddDto extends CommonVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId("id")
    @NotNull(message = "id不能为空",groups = {EditGroup.class})
    private Long id;

    @Schema(description = "名称",requiredMode = Schema.RequiredMode.REQUIRED,example = "用户列表")
    @TableField("name")
    @NotBlank(message = "名称不能为空",groups = {AddGroup.class, EditGroup.class})
    private String name;

    @Schema(description = "父级id",requiredMode = Schema.RequiredMode.REQUIRED,example = "1123454545")
    @TableField("parent_id")
//    @NotNull(message = "父级id不能为空",groups = {AddGroup.class})
    private Long parentId;

    @Schema(description = "排序")
    @NotNull(message = "排序不能为空",groups = {AddGroup.class, EditGroup.class})
    private Integer sort;

    @Schema(description = "路由地址")
    @NotBlank(message = "路由地址不能为空",groups = {AddGroup.class, EditGroup.class})
    private String routerUrl;

    @Schema(description = "图标")
    @NotBlank(message = "图标不能为空",groups = {AddGroup.class, EditGroup.class})
    private String icon;
}
